package com.xbts.system.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import javax.validation.constraints.NotEmpty;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import lombok.Data;
import com.xbts.common.annotation.Excel;
import com.xbts.common.utils.StringUtils;
import com.xbts.common.core.domain.BaseEntity;

/**
 * 素材配置对象 sei_config_material
 *
 * @author xbts
 * @date 2023-09-07
 */
@Data
@ApiModel("素材配置对象")
@TableName("sei_config_material")
public class SeiConfigMaterial extends BaseEntity {

private static final long serialVersionUID=1L;

    /** 素材配置id */
    @TableId
    private String materialId;

    /** 父级id
 */
    @Excel(name = "父级id")
    @ApiModelProperty("父级id ")
    @NotEmpty(message = "父级id不能为空")
    private String parentId;

    /** 名称 */
    @Excel(name = "名称")
    @ApiModelProperty("名称")
    @NotEmpty(message = "名称不能为空")
    private String name;

    /** 模板 */
    @Excel(name = "模板")
    @ApiModelProperty("模板")
    @NotEmpty(message = "模板不能为空")
    private String template;

    /** 配置id */
    @Excel(name = "配置id")
    @ApiModelProperty("配置id")
    @NotEmpty(message = "配置id不能为空")
    private String configId;


    public<T> QueryWrapper<T> queryWrapper(){
        QueryWrapper<T> queryWrapper=new QueryWrapper<>();
        queryWrapper.like(StringUtils.isNotEmpty(materialId),"material_id",materialId);
        queryWrapper.like(StringUtils.isNotEmpty(parentId),"parent_id",parentId);
        queryWrapper.like(StringUtils.isNotEmpty(name),"name",name);
        queryWrapper.like(StringUtils.isNotEmpty(template),"template",template);
        queryWrapper.like(StringUtils.isNotEmpty(configId),"config_id",configId);
        return queryWrapper;
    }
}